package com.chinamobile.errorfind.gameview;

import java.util.ArrayList;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Paint.Style;
import android.view.View;
import android.widget.ImageView;

public class FindingView extends ImageView {
	private ArrayList<Rect> diff_found;
	public FindingView(Context context) {
		super(context);
		// TODO Auto-generated constructor stub
		diff_found = new ArrayList<Rect>();
	}

	@Override
	protected void onDraw(Canvas canvas) {
		// TODO Auto-generated method stub
		super.onDraw(canvas);
		Paint paint = new Paint();
		paint.setColor(Color.RED);
		paint.setAntiAlias(true);
		paint.setStyle(Style.STROKE);
		paint.setStrokeWidth(5);
		for(int i=0;i<diff_found.size();i++)
		{
			canvas.drawRect(diff_found.get(i), paint);
		}
		
	}
	//push found diff location to array
	public void pushDiff(Rect rect)
	{
		diff_found.add(rect);
	}
	

}
